package drds.binlog;


import drds.binlog.binlog_task.BinlogTaskFactory;
import drds.binlog.binlog_task.IBinlogTask;
import drds.binlog.common.Authors;
import drds.binlog.server.Server;
import drds.common.Author;
import drds.common.Log;
import lombok.extern.slf4j.Slf4j;

@Author(name = Authors.LI_YANG)
@Slf4j
public class Test
{
    static
    {
        Log.info(log, "drds binlog组件真诚为你服务(" + Authors.LI_YANG + ")");
    }


    public static void main(String[] args) throws Exception
    {

        //前提是需要通过jdbc驱动进行查询该数据库是否存在,如果不存在后面的消息订阅任务取消.

        Server server = new Server();
        BinlogTaskFactory binlogTaskFactory = new BinlogTaskFactory();
        server.setBinlogTaskFactory(binlogTaskFactory);
        server.start();
        IBinlogTask binlogTask = binlogTaskFactory.config("xxx", "");

        server.getDestinationToBinlogTaskMap().put("xxx", binlogTask);
        server.start("xxx");

    }
}
